import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue';

Vue.use(VueRouter)

const routes = [{
  path: '/login',
  name: 'login',
  component: Login,
  meta: {
    isLogin: false
  }
},
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/Home.vue'),
    meta: {
      isLogin: true
    },
    children: [{
      path: '/home/diancai',
      name: 'diancai',
      component: () => import('../views/Diancai.vue')
    },
      {
        path: '/home/diancai/:id',
        name: 'diancai',
        component: () => import('../views/Diancai.vue')
      },
      {
        path: '/home/shouyin/:id',
        name: 'shouyin',
        component: () => import('../views/Shouyin.vue')
      },
      {
        path: '/home/shouyin',
        name: 'shouyin',
        component: () => import('../views/Shouyin.vue')
      },
      {
        path: '/home/menu',
        name: 'menu',
        component: () => import('../views/Menu.vue')
      },
      {
        path: '/home/vip',
        name: 'vip',
        component: () => import('../views/vip.vue')
      },
      {
        path: '/home/people',
        name: 'people',
        component: () => import('../views/People.vue')
      },
      {
        path: '/home/table',
        name: 'table',
        component: () => import('../views/Table.vue')
      }
    ]

  }, {
    path: '/',
    redirect: '/login'
  }
]

const router = new VueRouter({
  routes
})

export default router